import React, {Component} from 'react';
import {Relax} from 'iflux2';
import {
  Form, 
  Radio
} from 'antd';
import noop from 'util/noop';
const FormItem = Form.Item;
const RadioGroup = Radio.Group;

@Relax
export default class TypeSet extends Component{
  static defaultProps = {
    commentReplyAudit: 0,
    onSetting: noop
  }
  render() {
    let {layoutProps, commentReplyAudit, onSetting} = this.props;
    return (
      <FormItem label='商品评论审核设置' {...layoutProps}>
        <RadioGroup onChange={()=>onSetting({commentReplyAudit: commentReplyAudit ? 0 : 1})} value={commentReplyAudit}>
          <Radio value={0}>不需要审核评论立即生效</Radio>
          <Radio value={1}>需要管理员审核后生效</Radio>
        </RadioGroup>
      </FormItem>
    )
  }
}